Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(filter2, app(fun, x)), fun)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(copy, app(s, x)), y), z) → APP(copy, x)
APP(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → APP(app(app(copy, n), y), z)
APP(app(app(copy, app(s, x)), y), z) → APP(app(app(copy, x), y), app(app(cons, app(f, y)), z))
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(app(copy, app(s, x)), y), z) → APP(app(copy, x), y)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)
APP(app(app(copy, 0), y), z) → APP(f, z)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(copy, app(s, x)), y), z) → APP(cons, app(f, y))
APP(app(app(app(filter2, false), fun), x), xs) → APP(filter, fun)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(filter2, app(fun, x)), fun), x)
APP(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → APP(copy, n)
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(copy, app(s, x)), y), z) → APP(app(cons, app(f, y)), z)
APP(app(app(app(filter2, true), fun), x), xs) → APP(cons, x)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(filter2, app(fun, x))
APP(app(app(copy, app(s, x)), y), z) → APP(f, y)
APP(app(map, fun), app(app(cons, x), xs)) → APP(cons, app(fun, x))
APP(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → APP(app(copy, n), y)
APP(app(app(app(filter2, true), fun), x), xs) → APP(filter, fun)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(cons, x), app(app(filter, fun), xs))
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(cons, app(fun, x)), app(app(map, fun), xs))

The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(filter2, app(fun, x)), fun)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(copy, app(s, x)), y), z) → APP(copy, x)
APP(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → APP(app(app(copy, n), y), z)
APP(app(app(copy, app(s, x)), y), z) → APP(app(app(copy, x), y), app(app(cons, app(f, y)), z))
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(app(copy, app(s, x)), y), z) → APP(app(copy, x), y)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)
APP(app(app(copy, 0), y), z) → APP(f, z)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(copy, app(s, x)), y), z) → APP(cons, app(f, y))
APP(app(app(app(filter2, false), fun), x), xs) → APP(filter, fun)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(filter2, app(fun, x)), fun), x)
APP(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → APP(copy, n)
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(copy, app(s, x)), y), z) → APP(app(cons, app(f, y)), z)
APP(app(app(app(filter2, true), fun), x), xs) → APP(cons, x)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(filter2, app(fun, x))
APP(app(app(copy, app(s, x)), y), z) → APP(f, y)
APP(app(map, fun), app(app(cons, x), xs)) → APP(cons, app(fun, x))
APP(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → APP(app(copy, n), y)
APP(app(app(app(filter2, true), fun), x), xs) → APP(filter, fun)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(cons, x), app(app(filter, fun), xs))
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(cons, app(fun, x)), app(app(map, fun), xs))

The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 18 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ QDPOrderProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(copy, app(s, x)), y), z) → APP(app(app(copy, x), y), app(app(cons, app(f, y)), z))

The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


APP(app(app(copy, app(s, x)), y), z) → APP(app(app(copy, x), y), app(app(cons, app(f, y)), z))
The remaining pairs can at least be oriented weakly.
none
Used ordering: Polynomial interpretation [25,35]:

POL(APP(x1, x2)) = (1/2)x_1   
POL(n) = 5/4   
POL(cons) = 0   
POL(f) = 4   
POL(copy) = 7/4   
POL(app(x1, x2)) = (1/2)x_1 + (5/4)x_2   
POL(s) = 1/4   
POL(nil) = 0   
The value of delta used in the strict ordering is 5/128.
The following usable rules [17] were oriented: none



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ PisEmptyProof
          ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)

The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)
The remaining pairs can at least be oriented weakly.

APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
Used ordering: Polynomial interpretation [25,35]:

POL(n) = 0   
POL(f) = 1/4   
POL(true) = 0   
POL(copy) = 9/4   
POL(s) = 0   
POL(0) = 0   
POL(filter) = 3/2   
POL(APP(x1, x2)) = (3/2)x_2   
POL(cons) = 4   
POL(map) = 13/4   
POL(false) = 0   
POL(app(x1, x2)) = 1 + (1/4)x_1 + (4)x_2   
POL(filter2) = 0   
POL(nil) = 1/4   
The value of delta used in the strict ordering is 9/4.
The following usable rules [17] were oriented: none



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)

The TRS R consists of the following rules:

app(f, app(app(cons, nil), y)) → y
app(f, app(app(cons, app(f, app(app(cons, nil), y))), z)) → app(app(app(copy, n), y), z)
app(app(app(copy, 0), y), z) → app(f, z)
app(app(app(copy, app(s, x)), y), z) → app(app(app(copy, x), y), app(app(cons, app(f, y)), z))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.